#include<stdio.h>
int main(){
	int n,i,a,b,c,d,e,f;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	
	scanf("%d%d%d%d",&a,&b,&c,&d);
	e=a*c-b*d;
	f=a*d+b*c;
	if(f>=0)printf("%d %d",e,f);
	else printf("%d %d",e,f);}
    return 0;}
